package com.coachtam.ljgcapi.fallback;

import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Copyright (C), 2018-2020
 * @Author: JAVA在召唤
 * @Date: 2020-08-05 06:49
 * @Description:
 */
@RestController
public class GlobalFallback {

    @GetMapping("/fallback")
    public Map<String,Object> fallback() {
        HashMap<String, Object> result = new HashMap<>(2);
        result.put("status",HttpStatus.TOO_MANY_REQUESTS.value());
        result.put("msg","服务忙，请稍后再试");
        return result;
    }
}
